package lc;

import java.util.Arrays;

public class lc2212 {
    public static void main(String[] args) {
        lc2212 l = new lc2212();
        l.maxmunBobPoints(9,new int[]{1,1,0,1,0,0,2,1,0,1,2,0});
    }
    int[] res = new int[12];
    int[] aliceArrows;

    int max = 0;
    public int[] maxmunBobPoints(int numArrows, int[]aliceArrows){
        this.aliceArrows = aliceArrows;
//        this.numArrows = numArrows;
        dfs(0, 0, numArrows, new int[12]);
        return res;
    }

    private void dfs(int idx, int point, int numArrows, int[] cur) {
        if (idx == 11){
            if (point > max){
                max = point;
                cur[0] = numArrows;
                res = Arrays.copyOf(cur,12);
            }
        }
        if (numArrows > aliceArrows[idx + 1]){
            cur[idx + 1] = aliceArrows[idx + 1] + 1;
            dfs(idx + 1, point + idx + 1,numArrows - aliceArrows[idx + 1], cur);
        }
        //否则当前为0；也就是
        cur[idx + 1] = 0;
        dfs(idx + 1, point,numArrows,cur);
    }
}
